/*
 * @Author: yuluo
 * @Date: 2025-08-28
 * @LastEditors: yuluo
 * @LastEditTime: 2025-09-06
 * @FilePath: \Projecte:\gitee\GD32F427\gd32-f427-BootLoader\BSP\inc\drv_key.h
 * @Description: 
 * 如有特殊注意事项请填写
 * Copyright (c) by ${yuluo}, All Rights Reserved. 
 */

#ifndef DRV_KEY_H_
#define DRV_KEY_H_

#define KEY0_RCU RCU_GPIOE
#define KEY0_PORT GPIOE
#define KEY0_PIN GPIO_PIN_4
#define KEY0_PUPD GPIO_PUPD_PULLDOWN

#define KEY_WK_UP_RCU RCU_GPIOA
#define KEY_WK_UP_PORT GPIOA
#define KEY_WK_UP_PIN GPIO_PIN_0
#define KEY_WK_UP_PUPD GPIO_PUPD_PULLDOWN

#define KEY0_ID 1
#define KEY_WK_UP_ID 2
#define KEY_UPDATE_ID 3

void drv_key_init(void);
static uint8_t key0_read(void);
static uint8_t key_wk_up_read(void);
static uint8_t key_update_read(void);
static uint8_t touch_in_image(uint16_t sx, uint16_t sy, uint16_t ex, uint16_t ey);

void key_register(void);

static void key_event_handler(uint8_t id, ButtonEvent e);


#endif // !DRV_KEY_H_



